package com.zzh.rabbit;

import android.os.Bundle;
import android.util.Log;

import com.zzh.lib.core.utils.HFileUtils;
import com.zzh.lib.core.utils.HIOUtils;
import com.zzh.lib.core.utils.LogUtils;
import com.zzh.mvvm.base.BaseRabbitActivity;
import com.zzh.rabbit.databinding.ActTowBinding;

import java.io.File;
import java.io.IOException;

/**
 * Created by ZZH on 2022/6/2.
 *
 * @Date: 2022/6/2
 * @Email: zzh_hz@126.com
 * @QQ: 1299234582
 * @Author: zzh
 * @Description:
 */
public class TwoAct extends BaseRabbitActivity<TwoViewModel, ActTowBinding> {
    @Override
    protected void initViewAndData(Bundle savedInstanceState) {
        LogUtils.e("---TwoAct-------------");

    }

    @Override
    public void setListener() {
        super.setListener();
        bind.mtvWrite.setOnClickListener(v -> {
            File file = new File(HFileUtils.getPublicDocumentFilePath()+"/sub/sub", "sub.txt");
            try {
                HIOUtils.write("ceshiwenjian", file.getAbsolutePath(), true);
            } catch (IOException e) {
                LogUtils.e(e);
            }
        });

    }

    @Override
    protected int initVariableId() {
        return BR.viewModel;
    }

    @Override
    protected ActTowBinding initViewBinding(Bundle savedInstanceState) {
        return ActTowBinding.inflate(getLayoutInflater());
    }
}
